package com.whuan.student.client;


import com.whuan.student.dto.StudentDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by 廖师兄
 * 2017-12-10 21:04
 */
@FeignClient(name = "student", fallback = StudentClientFallback.class)
// @FeignClient(name = "student")
public interface StudentClient {

    @PostMapping("/findAll")
    List<StudentDTO> findAll();

    @GetMapping("/findOne")
    public StudentDTO findOne(@RequestParam String StudentId);
    @Component
    static class ClientFallback implements StudentClient{

        @Override
        public List<StudentDTO> findAll() {
            return null;
        }

        @Override
        public StudentDTO findOne(String StudentId) {
            return null;
        }
    }

}
